#ifndef _COLOUR_H
#define _COLOUR_H

#include <algorithm>

#ifdef GALLIUMENGINE_DLL 
#define GALLIUMENGINE_API __declspec( dllexport )
#else
#define GALLIUMENGINE_API __declspec( dllimport )
#endif

namespace GalliumEngine
{

	struct GALLIUMENGINE_API Colour
	{
		float value[4];

		Colour()
		{
			value[0] = 1.0f;
			value[1] = 1.0f;
			value[2] = 1.0f;
			value[3] = 1.0f;
		}

		#undef max
		#undef min

		Colour(float _r,float _g, float _b, float _a)
		{
			value[0] = std::max(0.0f,std::min(1.0f,_r));
			value[1] = std::max(0.0f,std::min(1.0f,_g));
			value[2] = std::max(0.0f,std::min(1.0f,_b));
			value[3] = std::max(0.0f,std::min(1.0f,_a));
		}

		float getR()
		{
			return value[0];
		}

		float getG()
		{
			return value[1];
		}

		float getB()
		{
			return value[2];
		}

		float getA()
		{
			return value[3];
		}

		void setR(float _r)
		{
			 value[0] = std::max(0.0f,std::min(1.0f,_r));;
		}

		void setG(float _g)
		{
			 value[1] = std::max(0.0f,std::min(1.0f,_g));
		}

		void setB(float _b)
		{
			 value[2] = std::max(0.0f,std::min(1.0f,_b));
		}

		void setA(float _a)
		{
			 value[3] = std::max(0.0f,std::min(1.0f,_a));
		}

		inline const float* getArray() const
		{
			return value;
		}
	};

}


#endif